Repository navigation
Fix FPU register save and restore instructions - #143
Merged
Merged
Conversation
Signed-off-by: whensun <theodoruswensanfebruanto025@gmail.com>
Member
|
Thank you for this PR. LGTM |
skehrli
added a commit
that referenced
this pull request
Nov 17, 2026
* Add OOPSLA paper, update dependencies (#126) Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Crypto dependency updates (#132) * update crypto dependencies to get rid of generic-array, use sha3-0.11 and upgrade ml-kem * formatting Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * update bindgen to 0.73, spin to 0.12, clap to 4.6 * update rand to 0.9 and generate random symmetric key and nonce in TAP serializer * update rand crate dependency to 0.10 Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Update AES GCM to 0.11.1 Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> --------- Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Compliance with CodeQL (#139) * make codebase comliant with CodeQL scans * update and reduce dependencies * Fix Github CI --------- Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Fix FPU register save and restore instructions (#143) Signed-off-by: whensun <theodoruswensanfebruanto025@gmail.com> * Preallocate vector in copy_from_non_confidential_memory (#142) Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Fix attestation secret release, key naming, and tests (#144) Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Increase ACE OpenSBI hart stack size to 16 KiB (#146) Signed-off-by: whensun <theodoruswensanfebruanto025@gmail.com> * fix: bump ocaml compiler in CI Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> * fix: disable opam sandboxing in verification CI Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> * fix: enforce single-job Rocq compilation in CI Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> * bump: refinedrust and matching rust toolchain Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> --------- Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> Signed-off-by: whensun <theodoruswensanfebruanto025@gmail.com> Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> Co-authored-by: Wojciech Ozga <woz@zurich.ibm.com> Co-authored-by: Whensun <143617993+whensun@users.noreply.github.com>
wojciechozga
added a commit
that referenced
this pull request
Nov 18, 2026
* Bump: RefinedRust * fix * update dev instructions for compat with current toolchains * fix: add missing rr::skip annotations * ci: allow 0 pruned modules * bump: refinedrust * bump: rust toolchain and RefinedRust * bump(wip): refinedrust * wip: fix * fix: try_write * bump: refinedrust * bump: refinedrust * fix: merge * bump: toolchain * bump: refinedrust * fix: proofs * fix: adapt to new panic handling * bump: refinedrust * bump: refinedrust * bump refinedrust * bump: refinedrust * merge main, bump refinedrust * Add OOPSLA paper, update dependencies (#126) Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Crypto dependency updates (#132) * update crypto dependencies to get rid of generic-array, use sha3-0.11 and upgrade ml-kem * formatting Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * update bindgen to 0.73, spin to 0.12, clap to 4.6 * update rand to 0.9 and generate random symmetric key and nonce in TAP serializer * update rand crate dependency to 0.10 Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Update AES GCM to 0.11.1 Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> --------- Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Compliance with CodeQL (#139) * make codebase comliant with CodeQL scans * update and reduce dependencies * Fix Github CI --------- Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Fix FPU register save and restore instructions (#143) Signed-off-by: whensun <theodoruswensanfebruanto025@gmail.com> * Preallocate vector in copy_from_non_confidential_memory (#142) Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Fix attestation secret release, key naming, and tests (#144) Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Increase ACE OpenSBI hart stack size to 16 KiB (#146) Signed-off-by: whensun <theodoruswensanfebruanto025@gmail.com> * fix: bump ocaml compiler in CI Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> * fix: disable opam sandboxing in verification CI Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> * fix: enforce single-job Rocq compilation in CI Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> * bump: refinedrust and matching rust toolchain Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> --------- Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> Signed-off-by: whensun <theodoruswensanfebruanto025@gmail.com> Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> Co-authored-by: Wojciech Ozga <woz@zurich.ibm.com> Co-authored-by: Whensun <143617993+whensun@users.noreply.github.com> * fix: explicitly enable H extension for security monitor builds Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> --------- Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> Signed-off-by: whensun <theodoruswensanfebruanto025@gmail.com> Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> Co-authored-by: Lennard Gäher <l.gaeher@posteo.de> Co-authored-by: Wojciech Ozga <woz@zurich.ibm.com> Co-authored-by: Whensun <143617993+whensun@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the changes
This PR fixes incorrect floating-point register save and restore instructions during heavy context switches.
Previously,
save_in_main_memory()usedfld, which loads values from memory into floating-point registers. Similarly,restore_from_main_memory()usedfsd, which stores floating-point registers into memory.These operations were reversed and could cause incorrect preservation of
f0–f31across context switches between the hypervisor and confidential VMs.This PR corrects the instructions:
save_in_main_memory()now usesfsdto savef0–f31into memory.restore_from_main_memory()now usesfldto restoref0–f31from memory.No other functionality is changed.
Type of change
How to test this PR?
f0–f31with known values.Static inspection confirms that the updated save and restore functions use the correct instructions for all 32 floating-point registers.
The patch also passes
git diff --check.